import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class FlowReduce extends Reducer<FlowBean, Text, Text, FlowBean> {
    @Override
    protected void reduce(FlowBean key, Iterable<Text> values, Reducer<FlowBean, Text, Text, FlowBean>.Context context) throws IOException, InterruptedException {
        System.out.println("----------调用reduce函数，参数：key = " + key.toString() + " values = " + values.toString());
        for (Text value : values) {
            context.write(value, key);
        }
    }
}
